package cn.iocoder.yudao.module.handguard.controller.app.userbasetable6;

import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;

import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;

import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUser;

import cn.iocoder.yudao.module.handguard.controller.app.userbasetable6.vo.*;
import cn.iocoder.yudao.module.handguard.dal.dataobject.userbasetable6.UserBaseTable6DO;
import cn.iocoder.yudao.module.handguard.convert.userbasetable6.UserBaseTable6Convert;
import cn.iocoder.yudao.module.handguard.service.userbasetable6.UserBaseTable6Service;

@Tag(name = "小程序 - 企业贴息贷款")
@RestController
@RequestMapping("/hutai/user-base-table6")
@Validated
public class UserBaseTable6Controller {

    @Resource
    private UserBaseTable6Service userBaseTable6Service;

    @PostMapping("/create")
    @Operation(summary = "创建企业贴息贷款")
    public CommonResult<Long> createUserBaseTable6(@Valid @RequestBody UserBaseTable6CreateReqVO createReqVO) {
        return success(userBaseTable6Service.createUserBaseTable6(createReqVO));
    }

    @PutMapping("/update")
    @Operation(summary = "更新企业贴息贷款")
    public CommonResult<Boolean> updateUserBaseTable6(@Valid @RequestBody UserBaseTable6UpdateReqVO updateReqVO) {
        userBaseTable6Service.updateUserBaseTable6(updateReqVO);
        return success(true);
    }


    @GetMapping("/get")
    @Operation(summary = "获得企业贴息贷款")
    public CommonResult<UserBaseTable6RespVO> getUserBaseTable6(Long ui) {
        UserBaseTable6DO userBaseTable6 = userBaseTable6Service.getUserBaseTable6(ui);
        return success(UserBaseTable6Convert.INSTANCE.convert(userBaseTable6));
    }







}
